package br.pucrs.lognplay.entity;

import java.util.UUID;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "CLIENT_")
public class Client extends GenericEntity<String> {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ID_")
	private String id;

	@Column(name = "NAME_")
	private String name;

	@Column(name = "RETENTION_PERIOD_")
	private Integer retentionPeriod;

	@OneToOne(mappedBy = "client", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private DynamicView dynamicView;

	public Client() {

	}

	public Client(UUID id) {
		this.id = id.toString();
	}

	public String getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getRetentionPeriod() {
		return retentionPeriod;
	}

	public void setRetentionPeriod(Integer retentionPeriod) {
		this.retentionPeriod = retentionPeriod;
	}

	public DynamicView getDynamicView() {
		return dynamicView;
	}

	public void setDynamicView(DynamicView dynamicView) {
		this.dynamicView = dynamicView;
	}
}
